﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.Model.Models
{
    /// <summary>
    /// 库存流水
    /// </summary>
    [Table("T_InventoryLog")]
    public class InventoryLog
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public long Id { get; set; }
        /// <summary>
        /// 来源单据类型：0:-入库；1-出库；2-盘点；3-手工调整；4-库存调整；
        /// </summary>
        public int? SourceType { get; set; }
        /// <summary>
        /// 来源单号
        /// </summary>
        [MaxLength(30)]
        public string SourceSn { get; set; }
        /// <summary>
        /// 仓库Id
        /// </summary>
        public long? WarehouseId { get; set; }
        /// <summary>
        /// 仓库名称
        /// </summary>
        [MaxLength(20)]
        public string WarehouseName { get; set; }
        /// <summary>
        /// 库区ID
        /// </summary>
        public long? AreaId { get; set; }
        /// <summary>
        /// 库区
        /// </summary>
        [MaxLength(20)]
        public string AreaName { get; set; }
        /// <summary>
        /// 仓位
        /// </summary>
        [MaxLength(20)]
        public string LocationCode { get; set; }
        /// <summary>
        /// 托盘号
        /// </summary>
        [MaxLength(20)]
        public string PalletBarcode { get; set; }
       
        /// <summary>
        /// 物料Id
        /// </summary>
        public long? MaterialId { get; set; }
        /// <summary>
        /// 物料编码
        /// </summary>
        [MaxLength(30)]
        public string MaterialCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        [MaxLength(30)]
        public string MaterialName { get; set; }
        /// <summary>
        /// 批次号
        /// </summary>
        [MaxLength(20)]
        public string BatchNo { get; set; }

        /// <summary>
        /// 原始数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? StartQty { get; set; }
        /// <summary>
        /// 变更数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? ChangeQty { get; set; }
        /// <summary>
        /// 最终数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? EndQty { get; set; }
        /// <summary>
        /// 基本单元Id
        /// </summary>
        public long? BaseUnitId { get; set; }
        /// <summary>
        /// 单位名称
        /// </summary>
        [MaxLength(20)]
        public string BaseUnitName { get; set; }

        /// <summary>
        /// 生成日期
        /// </summary>
        public DateTime? CreateDate
        {
            get;
            set;
        }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(100)]
        public string Remark { get; set; }
    }
}
